3.232 \(\int (a \sin (c+d x)+b \tan (c+d x)) \, dx\)

Optimal. Leaf size=26 \[ -\frac{a \cos (c+d x)}{d}-\frac{b \log (\cos (c+d x))}{d} \]

[Out]

-((a*Cos[c + d*x])/d) - (b*Log[Cos[c + d*x]])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0130983, antiderivative size = 26, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.118, Rules used = {2638, 3475} \[ -\frac{a \cos (c+d x)}{d}-\frac{b \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[a*Sin[c + d*x] + b*Tan[c + d*x],x]

[Out]

-((a*Cos[c + d*x])/d) - (b*Log[Cos[c + d*x]])/d

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (a \sin (c+d x)+b \tan (c+d x)) \, dx &=a \int \sin (c+d x) \, dx+b \int \tan (c+d x) \, dx\\ &=-\frac{a \cos (c+d x)}{d}-\frac{b \log (\cos (c+d x))}{d}\\ \end{align*}

Mathematica [A]  time = 0.01777, size = 37, normalized size = 1.42 \[ \frac{a \sin (c) \sin (d x)}{d}-\frac{a \cos (c) \cos (d x)}{d}-\frac{b \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[a*Sin[c + d*x] + b*Tan[c + d*x],x]

[Out]

-((a*Cos[c]*Cos[d*x])/d) - (b*Log[Cos[c + d*x]])/d + (a*Sin[c]*Sin[d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.014, size = 31, normalized size = 1.2 \begin{align*} -{\frac{a\cos \left ( dx+c \right ) }{d}}+{\frac{b\ln \left ( \left ( \tan \left ( dx+c \right ) \right ) ^{2}+1 \right ) }{2\,d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a*sin(d*x+c)+b*tan(d*x+c),x)

[Out]

-a*cos(d*x+c)/d+1/2*b/d*ln(tan(d*x+c)^2+1)

________________________________________________________________________________________

Maxima [A]  time = 1.06457, size = 34, normalized size = 1.31 \begin{align*} -\frac{a \cos \left (d x + c\right )}{d} + \frac{b \log \left (\sec \left (d x + c\right )\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*sin(d*x+c)+b*tan(d*x+c),x, algorithm="maxima")

[Out]

-a*cos(d*x + c)/d + b*log(sec(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 0.501073, size = 59, normalized size = 2.27 \begin{align*} -\frac{a \cos \left (d x + c\right ) + b \log \left (-\cos \left (d x + c\right )\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*sin(d*x+c)+b*tan(d*x+c),x, algorithm="fricas")

[Out]

-(a*cos(d*x + c) + b*log(-cos(d*x + c)))/d

________________________________________________________________________________________

Sympy [A]  time = 0.560458, size = 37, normalized size = 1.42 \begin{align*} a \left (\begin{cases} - \frac{\cos{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \sin{\left (c \right )} & \text{otherwise} \end{cases}\right ) + b \left (\begin{cases} \frac{\log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} & \text{for}\: d \neq 0 \\x \tan{\left (c \right )} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*sin(d*x+c)+b*tan(d*x+c),x)

[Out]

a*Piecewise((-cos(c + d*x)/d, Ne(d, 0)), (x*sin(c), True)) + b*Piecewise((log(tan(c + d*x)**2 + 1)/(2*d), Ne(d
, 0)), (x*tan(c), True))

________________________________________________________________________________________

Giac [A]  time = 1.12648, size = 36, normalized size = 1.38 \begin{align*} -\frac{a \cos \left (d x + c\right )}{d} - \frac{b \log \left ({\left | \cos \left (d x + c\right ) \right |}\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*sin(d*x+c)+b*tan(d*x+c),x, algorithm="giac")

[Out]

-a*cos(d*x + c)/d - b*log(abs(cos(d*x + c)))/d